/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.WindowConstants;
import static jdk.nashorn.internal.runtime.JSType.isNumber;
import easyscore.Jogo;
import easyscore.Jogador;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.Timer;

/**
 *
 * @author Rui Margarido
 */
public class PainelPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form PainelPrincipal_002
     */
    static ImageIcon img0, img1, img2, img3, img4, img5, img6, img7, img8, img9, imgVermelho, imgVerde, imgLaranja, imgAmarelo, imgVermelhoHorizontal;
    public static Jogo _Jogo;
    Timer timer;
    int _timeoutTeam = 0;
    
    public PainelPrincipal() {
        _Jogo = new Jogo();
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        initComponents();
        carregaImagens();
        //iniciaIndicadoresFaltasEquipa();
        //iniciaIndicadoresTimeout();
        
        timer = new Timer(1, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                UpdateGUI();
            }
        });
        timer.setRepeats(true);
        timer.setCoalesce(true);
        timer.setInitialDelay(0);
        timer.start();
        
    }
    
    // Faz Update à Interface para fazer update aos Valores.
    public void UpdateGUI(){
        // Faz update ao Jogo
        _Jogo.Update();
        
        // Pontos Equipa 1 e 2
        setPontos(_Jogo.getPontos(1),_Jogo.getPontos(2));
        
        // Tempo
        setTimeCronometro(_Jogo.getTempoMin(),_Jogo.getTempoSeg());
        
        // Botao de Ataque
        Botao24Segundos.setText(String.valueOf(_Jogo.getTempoAtaque()));
        
        // Botoes de TimeOut
        switch(_timeoutTeam){
            case 1:
                BotaoTimeoutEquipa1.setText(String.valueOf(_Jogo.getTimeout()));
                BotaoTimeoutEquipa2.setText("60");
                break;
            case 2:
                BotaoTimeoutEquipa1.setText("60");
                BotaoTimeoutEquipa2.setText(String.valueOf(_Jogo.getTimeout()));
                break;
            default:
                BotaoTimeoutEquipa1.setText("60");
                BotaoTimeoutEquipa2.setText("60");
                break;
        }
        checkParte(_Jogo.getParte());
        updateIndicadoresFaltasEquipa(_Jogo.getFaltasEquipa(1), _Jogo.getFaltasEquipa(2));
        updateIndicadoresTimeout(_Jogo.getTimeoutsEquipa(1), _Jogo.getTimeoutsEquipa(2));
        
        //caso tempo de ataque termine
        if(_Jogo.getTempoAtaque() <= 0)
            faltaFimTempoAtaque();

    }

    //Input numero pretendido
    //Output imagem do numero em formato ImageIcon
    public ImageIcon getImagemNumero(int i)
    {
        switch(i)
        {
            case 0:
                return img0;
            case 1:
                return img1;
            case 2:
                return img2;
            case 3:
                return img3;
            case 4:
                return img4;
            case 5:
                return img5;
            case 6:
                return img6;
            case 7:
                return img7;
            case 8:
                return img8;
            case 9:
                return img9;
        }
        return null;
    }
    
    public void setTimeCronometro(int minAtual, int segAtual)
    {
        int [] hora = new int[4];
        
        hora[0]= minAtual / 10;
        hora[1]= minAtual % 10;
        hora[2]= segAtual / 10;
        hora[3]= segAtual % 10;
        
        LabelCronometroUnidadesSegundos.setIcon(getImagemNumero(hora[3]));
        LabelCronometroDezenasSegundos.setIcon(getImagemNumero(hora[2])); 
        LabelCronometroUnidadesMinutos.setIcon(getImagemNumero(hora[1]));        
        LabelCronometroDezenasMinutos.setIcon(getImagemNumero(hora[0]));
        
    }
    
    public void setPontos(int equipa1, int equipa2)
    {
        int [] pontosEquipa1= new int[3];
        int [] pontosEquipa2= new int[3];
        
        pontosEquipa1[0] = equipa1 / 100;
        pontosEquipa2[0] = equipa2 / 100;
        pontosEquipa1[1] = (equipa1 % 100) / 10;
        pontosEquipa2[1] = (equipa2 % 100) / 10;
        pontosEquipa1[2] = equipa1 % 10;
        pontosEquipa2[2] = equipa2 % 10;
        
        //Preenche pontos equipa1
        LabelCentenasPontosEquipa1.setIcon(getImagemNumero(pontosEquipa1[0]));
        LabelDezenasPontosEquipa1.setIcon(getImagemNumero(pontosEquipa1[1]));
        LabelUnidadesPontosEquipa1.setIcon(getImagemNumero(pontosEquipa1[2]));
        
        //Preenche pontos equipa2
        LabelCentenasPontosEquipa2.setIcon(getImagemNumero(pontosEquipa2[0]));
        LabelDezenasPontosEquipa2.setIcon(getImagemNumero(pontosEquipa2[1]));
        LabelUnidadesPontosEquipa2.setIcon(getImagemNumero(pontosEquipa2[2]));
        
    }
    
    public void checkParte(int parte)
    {
        if(parte>=1)
        {
            LabelCronometroParte1.setIcon(imgVermelhoHorizontal);
            //LabelCronometroParte1.setForeground(Color.red);
            //LabelCronometroParte1.setBackground(Color.red);
        }
        if(parte>=2)
        {
            LabelCronometroParte2.setIcon(imgVermelhoHorizontal);
            //LabelCronometroParte2.setForeground(Color.red);
            //LabelCronometroParte2.setBackground(Color.red);
        }
        if(parte>=3)
        {
            LabelCronometroParte3.setIcon(imgVermelhoHorizontal);
            //LabelCronometroParte3.setForeground(Color.red);
            //LabelCronometroParte3.setBackground(Color.red);
        }
        if(parte>=4)
        {
            LabelCronometroParte4.setIcon(imgVermelhoHorizontal);
            //LabelCronometroParte4.setForeground(Color.red);
            //LabelCronometroParte4.setBackground(Color.red);
        }
    }
    
    public void iniciaIndicadoresFaltasEquipa()
    {
        Label1FaltasEquipa1.setIcon(imgVerde);
        Label2FaltasEquipa1.setIcon(imgVerde);
        Label3FaltasEquipa1.setIcon(imgAmarelo);
        Label4FaltasEquipa1.setIcon(imgLaranja);
        Label5FaltasEquipa1.setIcon(imgVermelho);
        
        Label1FaltasEquipa2.setIcon(imgVerde);
        Label2FaltasEquipa2.setIcon(imgVerde);
        Label3FaltasEquipa2.setIcon(imgAmarelo);
        Label4FaltasEquipa2.setIcon(imgLaranja);
        Label5FaltasEquipa2.setIcon(imgVermelho);
    }
    
    public void updateIndicadoresFaltasEquipa(int faltasEquipa1, int faltasEquipa2)
    {
        //Atualiza Faltas equipa 1
        if(faltasEquipa1>=1)
        {
            Label1FaltasEquipa1.setIcon(imgVerde);
            if(faltasEquipa1>=2)
            {
                Label2FaltasEquipa1.setIcon(imgVerde);
                if(faltasEquipa1>=3)
                {
                    Label3FaltasEquipa1.setIcon(imgAmarelo);
                    if(faltasEquipa1>=4)
                    {
                        Label4FaltasEquipa1.setIcon(imgLaranja);
                        if(faltasEquipa1>=5)
                            Label5FaltasEquipa1.setIcon(imgVermelho);
                    }
                }
            }
        }
        
        //Atualiza Faltas equipa 2
        if(faltasEquipa2>=1)
        {
            Label1FaltasEquipa2.setIcon(imgVerde);
            if(faltasEquipa2>=2)
            {
                Label2FaltasEquipa2.setIcon(imgVerde);
                if(faltasEquipa2>=3)
                {
                    Label3FaltasEquipa2.setIcon(imgAmarelo);
                    if(faltasEquipa2>=4)
                    {
                        Label4FaltasEquipa2.setIcon(imgLaranja);
                        if(faltasEquipa2>=5)
                            Label5FaltasEquipa2.setIcon(imgVermelho);
                    }
                }
            }
        }
    }
    
    public void iniciaIndicadoresTimeout()
    {
        Label1TimeoutEquipa1.setIcon(imgAmarelo);
        Label2TimeoutEquipa1.setIcon(imgAmarelo);
        Label3TimeoutEquipa1.setIcon(imgAmarelo);
        Label4TimeoutEquipa1.setIcon(imgAmarelo);
        Label5TimeoutEquipa1.setIcon(imgAmarelo);
        
        Label1TimeoutEquipa2.setIcon(imgAmarelo);
        Label2TimeoutEquipa2.setIcon(imgAmarelo);
        Label3TimeoutEquipa2.setIcon(imgAmarelo);
        Label4TimeoutEquipa2.setIcon(imgAmarelo);
        Label5TimeoutEquipa2.setIcon(imgAmarelo);
    }
    
    public void updateIndicadoresTimeout(int timeoutEquipa1,int timeoutEquipa2)
    {
        //Atualiza Faltas equipa 1
        Label1TimeoutEquipa1.setIcon(null);
        Label2TimeoutEquipa1.setIcon(null);
        Label3TimeoutEquipa1.setIcon(null);
        Label4TimeoutEquipa1.setIcon(null);
        Label5TimeoutEquipa1.setIcon(null);
        
        Label1TimeoutEquipa2.setIcon(null);
        Label2TimeoutEquipa2.setIcon(null);
        Label3TimeoutEquipa2.setIcon(null);
        Label4TimeoutEquipa2.setIcon(null);
        Label5TimeoutEquipa2.setIcon(null);
        
        if(timeoutEquipa1>=1)
        {
            Label1TimeoutEquipa1.setIcon(imgAmarelo);
            if(timeoutEquipa1>=2)
            {
                Label2TimeoutEquipa1.setIcon(imgAmarelo);
                if(timeoutEquipa1>=3)
                {
                    Label3TimeoutEquipa1.setIcon(imgAmarelo);
                    if(timeoutEquipa1>=4)
                    {
                        Label4TimeoutEquipa1.setIcon(imgAmarelo);
                        if(timeoutEquipa1>=5)
                            Label5TimeoutEquipa1.setIcon(imgAmarelo);
                    }
                }
            }
        }
        
        //Atualiza Faltas equipa 2
        if(timeoutEquipa2>=1)
        {
            Label1TimeoutEquipa2.setIcon(imgAmarelo);
            if(timeoutEquipa2>=2)
            {
                Label2TimeoutEquipa2.setIcon(imgAmarelo);
                if(timeoutEquipa2>=3)
                {
                    Label3TimeoutEquipa2.setIcon(imgAmarelo);
                    if(timeoutEquipa2>=4)
                    {
                        Label4TimeoutEquipa2.setIcon(imgAmarelo);
                        if(timeoutEquipa2>=5)
                            Label5TimeoutEquipa2.setIcon(imgAmarelo);
                    }
                }
            }
        }
    }
    
    public void faltaFimTempoAtaque()
    {
        _Jogo.Pausar();
        _Jogo.tempoataque();
        JOptionPane.showMessageDialog(null, "Falta, tempo de ataque terminado!");
    }
    
    public void carregaImagens()
    {
        img0 = new ImageIcon(getClass().getClassLoader().getResource("Resources/0.jpg"));
        img1 = new ImageIcon(getClass().getClassLoader().getResource("Resources/1.jpg"));
        img2 = new ImageIcon(getClass().getClassLoader().getResource("Resources/2.jpg"));
        img3 = new ImageIcon(getClass().getClassLoader().getResource("Resources/3.jpg"));
        img4 = new ImageIcon(getClass().getClassLoader().getResource("Resources/4.jpg"));
        img5 = new ImageIcon(getClass().getClassLoader().getResource("Resources/5.jpg"));
        img6 = new ImageIcon(getClass().getClassLoader().getResource("Resources/6.jpg"));
        img7 = new ImageIcon(getClass().getClassLoader().getResource("Resources/7.jpg"));
        img8 = new ImageIcon(getClass().getClassLoader().getResource("Resources/8.jpg"));
        img9 = new ImageIcon(getClass().getClassLoader().getResource("Resources/9.jpg"));
        //imgVerde = new ImageIcon(getClass().getClassLoader().getResource("Resources/IndicadorVerde.jpg"));
        imgVerde = new ImageIcon(getClass().getClassLoader().getResource("Resources/verde_novo.png"));
        //imgVermelho = new ImageIcon(getClass().getClassLoader().getResource("Resources/IndicadorVermelho.jpg"));
        imgVermelho = new ImageIcon(getClass().getClassLoader().getResource("Resources/vermelho_novo.png"));
        //imgAmarelo = new ImageIcon(getClass().getClassLoader().getResource("Resources/IndicadorAmarelo.jpg"));
        imgAmarelo = new ImageIcon(getClass().getClassLoader().getResource("Resources/amarelo_novo.png"));
        //imgLaranja = new ImageIcon(getClass().getClassLoader().getResource("Resources/IndicadorLaranja.jpg"));
        imgLaranja = new ImageIcon(getClass().getClassLoader().getResource("Resources/laranja_novo.png"));
        //imgVermelhoHorizontal = new ImageIcon(getClass().getClassLoader().getResource("Resources/IndicadorVermelho-horizontal.jpg"));
        imgVermelhoHorizontal = new ImageIcon(getClass().getClassLoader().getResource("Resources/vermelho_novo_horizontal.png"));
    }
    
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        LabelCentenasPontosEquipa1 = new javax.swing.JLabel();
        LabelDezenasPontosEquipa1 = new javax.swing.JLabel();
        LabelUnidadesPontosEquipa1 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        Label5FaltasEquipa1 = new javax.swing.JLabel();
        Label4FaltasEquipa1 = new javax.swing.JLabel();
        Label3FaltasEquipa1 = new javax.swing.JLabel();
        Label2FaltasEquipa1 = new javax.swing.JLabel();
        Label1FaltasEquipa1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        BotaoAdicionaUmPontoEquipa1 = new javax.swing.JButton();
        BotaoAdicionaDoisPontoEquipa1 = new javax.swing.JButton();
        BotaoAdicionaTresPontoEquipa1 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        LabelCentenasPontosEquipa2 = new javax.swing.JLabel();
        LabelDezenasPontosEquipa2 = new javax.swing.JLabel();
        LabelUnidadesPontosEquipa2 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        Label5FaltasEquipa2 = new javax.swing.JLabel();
        Label4FaltasEquipa2 = new javax.swing.JLabel();
        Label3FaltasEquipa2 = new javax.swing.JLabel();
        Label2FaltasEquipa2 = new javax.swing.JLabel();
        Label1FaltasEquipa2 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        BotaoAdicionaUmPontoEquipa2 = new javax.swing.JButton();
        BotaoAdicionaDoisPontoEquipa2 = new javax.swing.JButton();
        BotaoAdicionaTresPontoEquipa2 = new javax.swing.JButton();
        BotaoPlay = new javax.swing.JButton();
        BotaoPause = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        LabelCronometroDezenasMinutos = new javax.swing.JLabel();
        LabelCronometroUnidadesMinutos = new javax.swing.JLabel();
        LabelCronometroUnidadesSegundos = new javax.swing.JLabel();
        LabelCronometroDezenasSegundos = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        LabelCronometroParte1 = new javax.swing.JLabel();
        LabelCronometroParte2 = new javax.swing.JLabel();
        LabelCronometroParte3 = new javax.swing.JLabel();
        LabelCronometroParte4 = new javax.swing.JLabel();
        Botao24Segundos = new javax.swing.JButton();
        painelJogadoresEquipa1 = new javax.swing.JPanel();
        BotaoAdicionarJogadorEquipa1 = new javax.swing.JButton();
        BotaoAdicionarJogadorEquipa2 = new javax.swing.JButton();
        BotaoDesfazer = new javax.swing.JButton();
        jPanel14 = new javax.swing.JPanel();
        jPanel15 = new javax.swing.JPanel();
        BotaoTimeoutEquipa1 = new javax.swing.JButton();
        jPanel16 = new javax.swing.JPanel();
        Label1TimeoutEquipa1 = new javax.swing.JLabel();
        Label2TimeoutEquipa1 = new javax.swing.JLabel();
        Label3TimeoutEquipa1 = new javax.swing.JLabel();
        Label4TimeoutEquipa1 = new javax.swing.JLabel();
        Label5TimeoutEquipa1 = new javax.swing.JLabel();
        jPanel20 = new javax.swing.JPanel();
        jPanel21 = new javax.swing.JPanel();
        BotaoTimeoutEquipa2 = new javax.swing.JButton();
        jPanel22 = new javax.swing.JPanel();
        Label1TimeoutEquipa2 = new javax.swing.JLabel();
        Label2TimeoutEquipa2 = new javax.swing.JLabel();
        Label3TimeoutEquipa2 = new javax.swing.JLabel();
        Label4TimeoutEquipa2 = new javax.swing.JLabel();
        Label5TimeoutEquipa2 = new javax.swing.JLabel();
        BotaoNovoJogo = new javax.swing.JButton();
        BotaoSair = new javax.swing.JButton();
        painelJogadoresEquipa2 = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMaximumSize(new java.awt.Dimension(944, 692));
        setMinimumSize(new java.awt.Dimension(944, 692));

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        LabelCentenasPontosEquipa1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        LabelDezenasPontosEquipa1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        LabelUnidadesPontosEquipa1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(LabelCentenasPontosEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(LabelDezenasPontosEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(LabelUnidadesPontosEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(LabelCentenasPontosEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
            .addComponent(LabelDezenasPontosEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(LabelUnidadesPontosEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(Label1FaltasEquipa1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label2FaltasEquipa1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label3FaltasEquipa1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label4FaltasEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Label5FaltasEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(Label5FaltasEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label4FaltasEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label3FaltasEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label2FaltasEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(Label1FaltasEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        BotaoAdicionaUmPontoEquipa1.setText("1");
        BotaoAdicionaUmPontoEquipa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionaUmPontoEquipa1ActionPerformed(evt);
            }
        });

        BotaoAdicionaDoisPontoEquipa1.setText("2");
        BotaoAdicionaDoisPontoEquipa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionaDoisPontoEquipa1ActionPerformed(evt);
            }
        });

        BotaoAdicionaTresPontoEquipa1.setText("3");
        BotaoAdicionaTresPontoEquipa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionaTresPontoEquipa1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(BotaoAdicionaUmPontoEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaDoisPontoEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaTresPontoEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(BotaoAdicionaUmPontoEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaDoisPontoEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaTresPontoEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(91, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(20, Short.MAX_VALUE)))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jPanel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        LabelCentenasPontosEquipa2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        LabelDezenasPontosEquipa2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        LabelUnidadesPontosEquipa2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(LabelCentenasPontosEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(LabelDezenasPontosEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(LabelUnidadesPontosEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(LabelDezenasPontosEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
                .addComponent(LabelCentenasPontosEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE))
            .addComponent(LabelUnidadesPontosEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(Label1FaltasEquipa2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label2FaltasEquipa2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label3FaltasEquipa2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label4FaltasEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(Label5FaltasEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(Label5FaltasEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label4FaltasEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label3FaltasEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label2FaltasEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(Label1FaltasEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        BotaoAdicionaUmPontoEquipa2.setText("1");
        BotaoAdicionaUmPontoEquipa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionaUmPontoEquipa2ActionPerformed(evt);
            }
        });

        BotaoAdicionaDoisPontoEquipa2.setText("2");
        BotaoAdicionaDoisPontoEquipa2.setAlignmentY(0.0F);
        BotaoAdicionaDoisPontoEquipa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionaDoisPontoEquipa2ActionPerformed(evt);
            }
        });

        BotaoAdicionaTresPontoEquipa2.setText("3");
        BotaoAdicionaTresPontoEquipa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionaTresPontoEquipa2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(BotaoAdicionaUmPontoEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaDoisPontoEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaTresPontoEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(BotaoAdicionaUmPontoEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaDoisPontoEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                .addComponent(BotaoAdicionaTresPontoEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                    .addContainerGap(91, Short.MAX_VALUE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(20, Short.MAX_VALUE)))
        );

        BotaoPlay.setText("Play");
        BotaoPlay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoPlayActionPerformed(evt);
            }
        });

        BotaoPause.setText("Pause");
        BotaoPause.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoPauseActionPerformed(evt);
            }
        });

        jPanel9.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));

        jPanel10.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        LabelCronometroDezenasMinutos.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        LabelCronometroUnidadesMinutos.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        LabelCronometroUnidadesSegundos.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        LabelCronometroDezenasSegundos.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel25.setText("      :");

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(LabelCronometroDezenasMinutos, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LabelCronometroUnidadesMinutos, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel25, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LabelCronometroDezenasSegundos, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LabelCronometroUnidadesSegundos, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(LabelCronometroDezenasMinutos, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
            .addComponent(LabelCronometroUnidadesMinutos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(LabelCronometroUnidadesSegundos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(LabelCronometroDezenasSegundos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jLabel25, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jPanel11.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        LabelCronometroParte1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        LabelCronometroParte1.setMaximumSize(new java.awt.Dimension(73, 40));
        LabelCronometroParte1.setMinimumSize(new java.awt.Dimension(73, 40));
        LabelCronometroParte1.setPreferredSize(new java.awt.Dimension(73, 40));

        LabelCronometroParte2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        LabelCronometroParte2.setMaximumSize(new java.awt.Dimension(77, 40));
        LabelCronometroParte2.setMinimumSize(new java.awt.Dimension(77, 40));
        LabelCronometroParte2.setPreferredSize(new java.awt.Dimension(77, 40));

        LabelCronometroParte3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        LabelCronometroParte3.setMaximumSize(new java.awt.Dimension(66, 40));
        LabelCronometroParte3.setMinimumSize(new java.awt.Dimension(66, 40));
        LabelCronometroParte3.setPreferredSize(new java.awt.Dimension(66, 40));

        LabelCronometroParte4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        LabelCronometroParte4.setMaximumSize(new java.awt.Dimension(66, 40));
        LabelCronometroParte4.setMinimumSize(new java.awt.Dimension(66, 40));
        LabelCronometroParte4.setPreferredSize(new java.awt.Dimension(66, 40));

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(LabelCronometroParte1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LabelCronometroParte2, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LabelCronometroParte3, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LabelCronometroParte4, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(LabelCronometroParte1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(LabelCronometroParte2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(LabelCronometroParte3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(LabelCronometroParte4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        Botao24Segundos.setText("24");
        Botao24Segundos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Botao24SegundosActionPerformed(evt);
            }
        });

        painelJogadoresEquipa1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
        painelJogadoresEquipa1.setMaximumSize(new java.awt.Dimension(305, 304));
        painelJogadoresEquipa1.setMinimumSize(new java.awt.Dimension(305, 304));
        painelJogadoresEquipa1.setPreferredSize(new java.awt.Dimension(305, 304));

        BotaoAdicionarJogadorEquipa1.setText("Adicionar Jogador");
        BotaoAdicionarJogadorEquipa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionarJogadorEquipa1ActionPerformed(evt);
            }
        });

        BotaoAdicionarJogadorEquipa2.setText("Adicionar Jogador");
        BotaoAdicionarJogadorEquipa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoAdicionarJogadorEquipa2ActionPerformed(evt);
            }
        });

        BotaoDesfazer.setText("Desfazer");

        jPanel14.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jPanel15.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        BotaoTimeoutEquipa1.setText("60");
        BotaoTimeoutEquipa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoTimeoutEquipa1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BotaoTimeoutEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BotaoTimeoutEquipa1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
        );

        jPanel16.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        Label1TimeoutEquipa1.setMaximumSize(new java.awt.Dimension(15, 25));
        Label1TimeoutEquipa1.setMinimumSize(new java.awt.Dimension(15, 25));
        Label1TimeoutEquipa1.setPreferredSize(new java.awt.Dimension(15, 25));

        Label2TimeoutEquipa1.setMaximumSize(new java.awt.Dimension(18, 25));
        Label2TimeoutEquipa1.setMinimumSize(new java.awt.Dimension(18, 25));
        Label2TimeoutEquipa1.setPreferredSize(new java.awt.Dimension(18, 25));

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addComponent(Label1TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label2TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label3TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label4TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label5TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(Label1TimeoutEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label2TimeoutEquipa1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label3TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label4TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label5TimeoutEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel20.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jPanel21.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        BotaoTimeoutEquipa2.setText("60");
        BotaoTimeoutEquipa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoTimeoutEquipa2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BotaoTimeoutEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BotaoTimeoutEquipa2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
        );

        jPanel22.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        Label1TimeoutEquipa2.setMaximumSize(new java.awt.Dimension(15, 25));
        Label1TimeoutEquipa2.setMinimumSize(new java.awt.Dimension(15, 25));
        Label1TimeoutEquipa2.setPreferredSize(new java.awt.Dimension(15, 25));

        Label2TimeoutEquipa2.setMaximumSize(new java.awt.Dimension(18, 25));
        Label2TimeoutEquipa2.setMinimumSize(new java.awt.Dimension(18, 25));
        Label2TimeoutEquipa2.setPreferredSize(new java.awt.Dimension(18, 25));

        javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
        jPanel22.setLayout(jPanel22Layout);
        jPanel22Layout.setHorizontalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addComponent(Label1TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label2TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label3TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label4TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Label5TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1))
        );
        jPanel22Layout.setVerticalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(Label1TimeoutEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label2TimeoutEquipa2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Label3TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label4TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(Label5TimeoutEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        BotaoNovoJogo.setText("Novo Jogo");

        BotaoSair.setText("Sair");

        painelJogadoresEquipa2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
        painelJogadoresEquipa2.setMaximumSize(new java.awt.Dimension(305, 304));
        painelJogadoresEquipa2.setMinimumSize(new java.awt.Dimension(305, 304));
        painelJogadoresEquipa2.setPreferredSize(new java.awt.Dimension(305, 304));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(50, 50, 50)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(BotaoPlay, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(BotaoPause, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(painelJogadoresEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(BotaoAdicionarJogadorEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(BotaoDesfazer)
                                        .addGap(0, 0, Short.MAX_VALUE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(Botao24Segundos, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(BotaoAdicionarJogadorEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(painelJogadoresEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(50, 50, 50))
            .addGroup(layout.createSequentialGroup()
                .addComponent(BotaoNovoJogo, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(BotaoSair, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(BotaoNovoJogo)
                            .addComponent(BotaoSair))
                        .addGap(61, 61, 61)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap(107, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(BotaoPlay, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
                            .addComponent(BotaoPause, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(46, 46, 46)
                        .addComponent(Botao24Segundos, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 70, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(painelJogadoresEquipa2, javax.swing.GroupLayout.PREFERRED_SIZE, 304, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(painelJogadoresEquipa1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(BotaoAdicionarJogadorEquipa2)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(BotaoAdicionarJogadorEquipa1)
                        .addComponent(BotaoDesfazer)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BotaoPauseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoPauseActionPerformed
        // TODO add your handling code here:
        _Jogo.Pausar();
    }//GEN-LAST:event_BotaoPauseActionPerformed

    private void BotaoAdicionarJogadorEquipa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionarJogadorEquipa1ActionPerformed
        String number;
        number = JOptionPane.showInputDialog("Introduza o numero do jogador"); 
        if(isNumber(number))
        {
            int i_num = Integer.parseInt(number);
            if(i_num > 99 || i_num < 4){
                JOptionPane.showMessageDialog(null, "Jogador não criado pois foi inserido um numero inválido. Tem de estar entre 4 e 99");
                return;
            }
            if(_Jogo.existJogador(1, i_num)){
                JOptionPane.showMessageDialog(null, "Jogador não criado pois já existe um Jogador com numero: "+i_num);
               return; 
            }
            PainelJogador player = new PainelJogador(Integer.parseInt(number), 1, _Jogo.getNumJogadores(1));
            Jogador jogador = new Jogador();
            jogador.setNumero(i_num);
            _Jogo.AdicionarJogador(1, jogador);
            painelJogadoresEquipa1.add(player);
            painelJogadoresEquipa1.repaint();
            painelJogadoresEquipa1.revalidate();
        }
        else
            JOptionPane.showMessageDialog(null, "Jogador não criado pois nao foi inserido um numero");
    }//GEN-LAST:event_BotaoAdicionarJogadorEquipa1ActionPerformed

    private void BotaoAdicionarJogadorEquipa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionarJogadorEquipa2ActionPerformed
        String number;
        number = JOptionPane.showInputDialog("Introduza o numero do jogador");
        if(isNumber(number))
        {
            int i_num = Integer.parseInt(number);
            if(i_num > 99 || i_num < 4){
                JOptionPane.showMessageDialog(null, "Jogador não criado pois foi inserido um numero inválido. Tem de estar entre 4 e 99");
                return;
            }
            if(_Jogo.existJogador(2, i_num)){
                JOptionPane.showMessageDialog(null, "Jogador não criado pois já existe um Jogador com numero: "+i_num);
               return; 
            }
            PainelJogador player = new PainelJogador(Integer.parseInt(number), 2, _Jogo.getNumJogadores(2));
            Jogador jogador = new Jogador();
            jogador.setNumero(i_num);
            _Jogo.AdicionarJogador(2, jogador);
            painelJogadoresEquipa2.add(player);
            painelJogadoresEquipa2.repaint();
            painelJogadoresEquipa2.revalidate();
        }
        else
            JOptionPane.showMessageDialog(null, "Jogador não criado pois nao foi inserido um numero");
    }//GEN-LAST:event_BotaoAdicionarJogadorEquipa2ActionPerformed

    private void BotaoAdicionaUmPontoEquipa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionaUmPontoEquipa1ActionPerformed
        // TODO add your handling code here:
        _Jogo.adicionarPonto(1, 1);
    }//GEN-LAST:event_BotaoAdicionaUmPontoEquipa1ActionPerformed

    private void BotaoAdicionaDoisPontoEquipa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionaDoisPontoEquipa1ActionPerformed
        // TODO add your handling code here:
        _Jogo.adicionarPonto(1, 2);
    }//GEN-LAST:event_BotaoAdicionaDoisPontoEquipa1ActionPerformed

    private void BotaoAdicionaTresPontoEquipa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionaTresPontoEquipa1ActionPerformed
        // TODO add your handling code here:
        _Jogo.adicionarPonto(1, 3);
    }//GEN-LAST:event_BotaoAdicionaTresPontoEquipa1ActionPerformed

    private void BotaoAdicionaUmPontoEquipa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionaUmPontoEquipa2ActionPerformed
        // TODO add your handling code here:
        _Jogo.adicionarPonto(2, 1);
    }//GEN-LAST:event_BotaoAdicionaUmPontoEquipa2ActionPerformed

    private void BotaoAdicionaDoisPontoEquipa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionaDoisPontoEquipa2ActionPerformed
        // TODO add your handling code here:
        _Jogo.adicionarPonto(2, 2);
    }//GEN-LAST:event_BotaoAdicionaDoisPontoEquipa2ActionPerformed

    private void BotaoAdicionaTresPontoEquipa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoAdicionaTresPontoEquipa2ActionPerformed
        // TODO add your handling code here:
        _Jogo.adicionarPonto(2, 3);
    }//GEN-LAST:event_BotaoAdicionaTresPontoEquipa2ActionPerformed

    private void BotaoPlayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoPlayActionPerformed
        // TODO add your handling code here:
        if(_Jogo.getNumJogadores(1) > 4 && _Jogo.getNumJogadores(2) > 4){
            _Jogo.Iniciar();
        }
        
    }//GEN-LAST:event_BotaoPlayActionPerformed

    private void Botao24SegundosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Botao24SegundosActionPerformed
        // TODO add your handling code here:
        _Jogo.tempoataque();
    }//GEN-LAST:event_Botao24SegundosActionPerformed

    private void BotaoTimeoutEquipa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoTimeoutEquipa1ActionPerformed
        // TODO add your handling code here:
        _timeoutTeam = 1;
        _Jogo.timeout(1);
    }//GEN-LAST:event_BotaoTimeoutEquipa1ActionPerformed

    private void BotaoTimeoutEquipa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoTimeoutEquipa2ActionPerformed
        // TODO add your handling code here:
        _timeoutTeam = 2;
        _Jogo.timeout(2);
    }//GEN-LAST:event_BotaoTimeoutEquipa2ActionPerformed

    public void run() {
        new PainelPrincipal().setVisible(true);
    }
    
    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(PainelPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(PainelPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(PainelPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(PainelPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new PainelPrincipal().setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Botao24Segundos;
    private javax.swing.JButton BotaoAdicionaDoisPontoEquipa1;
    private javax.swing.JButton BotaoAdicionaDoisPontoEquipa2;
    private javax.swing.JButton BotaoAdicionaTresPontoEquipa1;
    private javax.swing.JButton BotaoAdicionaTresPontoEquipa2;
    private javax.swing.JButton BotaoAdicionaUmPontoEquipa1;
    private javax.swing.JButton BotaoAdicionaUmPontoEquipa2;
    private javax.swing.JButton BotaoAdicionarJogadorEquipa1;
    private javax.swing.JButton BotaoAdicionarJogadorEquipa2;
    private javax.swing.JButton BotaoDesfazer;
    private javax.swing.JButton BotaoNovoJogo;
    private javax.swing.JButton BotaoPause;
    private javax.swing.JButton BotaoPlay;
    private javax.swing.JButton BotaoSair;
    private javax.swing.JButton BotaoTimeoutEquipa1;
    private javax.swing.JButton BotaoTimeoutEquipa2;
    private javax.swing.JLabel Label1FaltasEquipa1;
    private javax.swing.JLabel Label1FaltasEquipa2;
    private javax.swing.JLabel Label1TimeoutEquipa1;
    private javax.swing.JLabel Label1TimeoutEquipa2;
    private javax.swing.JLabel Label2FaltasEquipa1;
    private javax.swing.JLabel Label2FaltasEquipa2;
    private javax.swing.JLabel Label2TimeoutEquipa1;
    private javax.swing.JLabel Label2TimeoutEquipa2;
    private javax.swing.JLabel Label3FaltasEquipa1;
    private javax.swing.JLabel Label3FaltasEquipa2;
    private javax.swing.JLabel Label3TimeoutEquipa1;
    private javax.swing.JLabel Label3TimeoutEquipa2;
    private javax.swing.JLabel Label4FaltasEquipa1;
    private javax.swing.JLabel Label4FaltasEquipa2;
    private javax.swing.JLabel Label4TimeoutEquipa1;
    private javax.swing.JLabel Label4TimeoutEquipa2;
    private javax.swing.JLabel Label5FaltasEquipa1;
    private javax.swing.JLabel Label5FaltasEquipa2;
    private javax.swing.JLabel Label5TimeoutEquipa1;
    private javax.swing.JLabel Label5TimeoutEquipa2;
    private javax.swing.JLabel LabelCentenasPontosEquipa1;
    private javax.swing.JLabel LabelCentenasPontosEquipa2;
    private javax.swing.JLabel LabelCronometroDezenasMinutos;
    private javax.swing.JLabel LabelCronometroDezenasSegundos;
    private javax.swing.JLabel LabelCronometroParte1;
    private javax.swing.JLabel LabelCronometroParte2;
    private javax.swing.JLabel LabelCronometroParte3;
    private javax.swing.JLabel LabelCronometroParte4;
    private javax.swing.JLabel LabelCronometroUnidadesMinutos;
    private javax.swing.JLabel LabelCronometroUnidadesSegundos;
    private javax.swing.JLabel LabelDezenasPontosEquipa1;
    private javax.swing.JLabel LabelDezenasPontosEquipa2;
    private javax.swing.JLabel LabelUnidadesPontosEquipa1;
    private javax.swing.JLabel LabelUnidadesPontosEquipa2;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel painelJogadoresEquipa1;
    private javax.swing.JPanel painelJogadoresEquipa2;
    // End of variables declaration//GEN-END:variables
}
